{% extends 'dashboard/base.html' %}

{% block body %}

        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-body">
                        <br>
                        <div class="d-md-flex align-items-center">
                            <h1 class="card-title">Vulnerability List</h1>
                        </div>
                        <br>
                        <div class="row">
                            <div class="table-responsive">
                                <table id="data_table" class="table table-bordered data-table table-fixed"
                                       width="100%">
                                    <thead>
                                    <tr>
                                        <th>Vulnerability</th>
                                        <th>Status</th>
                                        <th>Risk</th>
                                    </tr>
                                    </thead>
                                    <tbody>{% for data in all_vuln %}
                                    <tr data-target="#">
                                        <td>
                                            <a href="{% url 'webscanners:list_vuln_info' %}?scan_id={{data.scan_id}}&scan_name={{data.title}}">{{data.title}}</a>
                                        </td>
                                        {% if data.vuln_status == 'Open' %}
                                        <td><span class="badge badge-pill badge-purple">{{data.vuln_status}}</span>
                                        {% if data.note != None %}
                                            <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                        {% endif %}
                                        </td>
                                        {% endif %}
                                        {% if data.vuln_status == 'Closed' %}
                                        <td><span class="badge badge-pill badge-success">{{data.vuln_status}}</span>
                                        {% if data.note != None %}
                                         <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                        {% endif %}
                                        </td>
                                        {% endif %}
                                        {% if data.vuln_status == 'Duplicate' %}
                                        <td><span class="badge badge-pill badge-warning">{{data.vuln_status}}</span></td>
                                        {% endif %}
                                        <td><span class="badge badge-pill badge-{{data.severity_color}}">{{data.severity}}</span>
                                        </td>
                                    </tr>
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

{% endblock %}
